// eslint-disable-next-line no-control-regex
const UNICODE_MATCH_REG = /[^\x00-\xff]/g;
// eslint-disable-next-line no-useless-escape
const CONTENT_MATCH_REG = /(?<!-)content\s*:\s*([^;\}]+)/g;
module.exports = function (source) {
    source = source.replace(CONTENT_MATCH_REG, function (m, p1) {
        return m.replace(UNICODE_MATCH_REG, function (m) {
            return '\\' + m.charCodeAt(0).toString(16);
        });
    });
    return source;
};
